#ifndef MAINWINDOW_H
#define MAINWINDOW_H


#include <QMainWindow>
#include <QMessageBox>
#include <QFileDialog>
#include <QObject>
#include <QString>
#include <QObject>
#include <QDir>
#include <QTextStream>
#include <QStandardPaths>
#include <QFileSystemModel>
#include <QInputDialog>
#include <QTextEdit>
#include <QTextBrowser>


QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    QString getinitialPath();
    void saveFile(const QString &filePath);

private slots:
    void onTreeViewClicked(const QModelIndex &index);
    //文件（F）信号槽处理
    void openFile();
    void openFolder();
    void onNewFileAction();
    void onNewWindowAction();
    void onSaveAction();
    void onSaveAsAction();

    // //实时预览信号槽
    // void updateMarkdownPreview();


private:
    bool fileOpened = false;
    QString currentFilePath = "";
    QFileSystemModel *fileSystemModel;
};


#endif // MAINWINDOW_H
